package net.lahuobao.export.service.impl;

import java.lang.reflect.Field;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.lahuobao.export.service.comm.ITranfGen;
import net.lahuobao.export.service.tranf.IDateTranf;
import net.lahuobao.export.service.tranf.IDicTranf;
import net.lahuobao.export.service.tranf.IEnumTranf;
import net.lahuobao.export.service.tranf.INullTranf;
/**
 * 翻译总类
 * @author Administrator
 *
 */
@Service("tranfGenService")
public class TranfGenImpl implements ITranfGen {
	@Autowired
	private IDicTranf dicTranfService;
	@Autowired
	private IDateTranf dateTranfService;
	@Autowired
	private IEnumTranf enumTranfService;
	@Override
	public Object tranf(Object c, Field field,int flag) {
			Object obj=null;
			if(flag==1){//字典类型
				obj=dicTranfService.dicTranf(c,field);
			}else if(flag==2){//时间类型
				obj=dateTranfService.dateTranf(c,field);
			}else if(flag==3){//枚举类型
				obj=enumTranfService.enumTranf(c, field);
			}
			return obj;
	}
	
	
}
